home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / Xm / XmQTdialogShellSavvy.z / XmQTdialogShellSavvy
Text File  |  1998-10-30  |  11KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))  UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV  XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y - A dialog widget holding this trait
  10.           can become a child of the XmDialogShell widget
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.           #include <Xm/DialogSavvyT.h>
  14.  
  15.           typedef struct {
  16.                     int                             version;
  17.                     XmDialogSavvyMapUnmapProc       callMapUnmapCB;
  18.           } XmDialogSavvyTraitRec,*XmDialogSavvyTrait;
  19.           vvvvooooiiiidddd ((((****XXXXmmmmDDDDiiiiaaaallllooooggggSSSSaaaavvvvvvvvyyyyMMMMaaaappppUUUUnnnnmmmmaaaappppPPPPrrrroooocccc))))(
  20.           WWWWiiiiddddggggeeeetttt,
  21.           BBBBoooooooolllleeeeaaaannnn);
  22.  
  23.      VVVVEEEERRRRSSSSIIIIOOOONNNN
  24.           This page documents Motif 2.1.
  25.  
  26.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.           A widget holding the _X_m_Q_T_d_i_a_l_o_g_S_a_v_v_y trait can become an
  28.           immediate child of the XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll widget.  In other
  29.           words, the _X_m_Q_T_d_i_a_l_o_g_S_a_v_v_y trait announces to the
  30.           XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll widget that your widget is an acceptable
  31.           child.
  32.  
  33.           Every dialog widget that holds the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y
  34.           trait must provide the following:
  35.  
  36.              +o  A ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB trait method
  37.  
  38.              +o  A default position resource
  39.  
  40.              +o  Code that detects an XXXXmmmmDDDDIIIIAAAALLLLOOOOGGGG____SSSSAAAAVVVVVVVVYYYY____FFFFOOOORRRRCCCCEEEE____OOOORRRRIIIIGGGGIIIINNNN
  41.                 situation
  42.  
  43.           Any widget that installs the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait must
  44.           provide a BBBBoooooooolllleeeeaaaannnn default position resource.  For example,
  45.           EEEExxxxmmmmGGGGrrrriiiidddd and XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd both provide a BBBBoooooooolllleeeeaaaannnn default
  46.           position resource named XXXXmmmmNNNNddddeeeeffffaaaauuuullllttttPPPPoooossssiiiittttiiiioooonnnn.  This resource
  47.           controls the positioning of the DialogShell managing your
  48.           _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y widget.  This resource has no influence
  49.           if your _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_ywidget is not managed by a
  50.           DialogShell.  For example, if the parent of the DialogShell
  51.           is an ApplicationShell, then the center of the DialogShell
  52.           will be at the same coordinates as the center of the
  53.           ApplicationShell.  If the DialogShell becomes unmapped (but
  54.           stays managed) and then remapped, this resource has no
  55.           influence on the DialogShell's position.  If the default
  56.           position resource is False, the DialogShell does not
  57.           automatically center itself.  Instead, the DialogShell (and
  58.           therefore its _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y child) will be positioned
  59.           according to the values of XXXXmmmmNNNNxxxx and XXXXmmmmNNNNyyyy.  Motif will treat
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/24/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))  UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV  XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))
  71.  
  72.  
  73.  
  74.           the values of XXXXmmmmNNNNxxxx and XXXXmmmmNNNNyyyy as offsets from the upper-left
  75.           corner of the screen (rather than as offsets from the
  76.           upper-left corner of the parent shell).
  77.  
  78.           The XXXXmmmm////DDDDiiiiaaaallllooooggggSSSSaaaavvvvvvvvyyyyTTTT....hhhh header file provides a special macro
  79.           constant named XXXXmmmmDDDDIIIIAAAALLLLOOOOGGGG____SSSSAAAAVVVVVVVVYYYY____FFFFOOOORRRRCCCCEEEE____OOOORRRRIIIIGGGGIIIINNNN.  Any widget
  80.           holding the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait must use this
  81.           constant.  Here is the problem that
  82.           XXXXmmmmDDDDIIIIAAAALLLLOOOOGGGG____SSSSAAAAVVVVVVVVYYYY____FFFFOOOORRRRCCCCEEEE____OOOORRRRIIIIGGGGIIIINNNN solves.  The current position of
  83.           a dialog child widget within an XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllllwidget is
  84.           always 0,0. Suppose a user or application calls XXXXttttSSSSeeeettttVVVVaaaalllluuuueeeessss
  85.           to set the dialog child widget's x-coordinate or y-
  86.           coordinate to 0.  In this case, the Intrinsics will not
  87.           detect a geometry change and will therefore not trigger a
  88.           geometry request.  To tell the XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll widget that you
  89.           really do want the child to move to a coordinate of 0, your
  90.           dialog child widget must catch this request and respond to
  91.           it by setting the x-coordinate or y-coordinate to
  92.           XXXXmmmmDDDDIIIIAAAALLLLOOOOGGGG____SSSSAAAAVVVVVVVVYYYY____FFFFOOOORRRRCCCCEEEE____OOOORRRRIIIIGGGGIIIINNNN instead of 0. For example:
  93.  
  94.             if (my_dialog_widget->core.x == 0)
  95.               my_dialog_widget->core.x = XmDIALOG_SAVVY_FORCE_ORIGIN;
  96.             ...
  97.             if (my_dialog_widget->core.y == 0)
  98.               my_dialog_widget->core.y = XmDIALOG_SAVVY_FORCE_ORIGIN;
  99.  
  100.           In the standard Motif widget set, the XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd widget
  101.           and all its subclasses hold the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait.
  102.           In the Exm demonstration widget set, the _E_x_m_G_r_i_d widget
  103.           installs the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait.
  104.  
  105.           The XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll widget is the only standard Motif widget
  106.           that examines its children for this trait.
  107.  
  108.         TTTThhhheeee ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd
  109.           vvvvooooiiiidddd ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB(
  110.           WWWWiiiiddddggggeeeetttt ddddiiiiaaaallllooooggggWWWWiiiiddddggggeeeetttt,
  111.           BBBBoooooooolllleeeeaaaannnn mmmmaaaapppp____uuuunnnnmmmmaaaapppp);
  112.  
  113.           All dialog widgets holding the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait
  114.           must provide the ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB trait method.  The
  115.           ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB trait method is responsible for calling the
  116.           map or unmap callback of the widget. For example, following
  117.           is one possible way of implementing this trait method:
  118.  
  119.           static void
  120.           CallMapUnmap(
  121.                    Widget dialogWidget,
  122.                    Boolean map_unmap)
  123.           {
  124.            ExmMyDialogWidget dw = (ExmMyDialogWidget) dialogWidget;
  125.            XmAnyCallbackStruct call_data;
  126.  
  127.  
  128.  
  129.      Page 2                                         (printed 10/24/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))  UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV  XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))
  137.  
  138.  
  139.  
  140.              call_data.reason = map_unmap ? XmCR_MAP: XmCR_UNMAP;
  141.              call_data.event  = NULL;
  142.              if (map_unmap)
  143.                XtCallCallbackList (dialogWidget, dw->my_dialog.map_callback,
  144.                                    &call_data);
  145.              else
  146.                XtCallCallbackList (dialogWidget, dw->my_dialog.unmap_callback,
  147.                                    &call_data);
  148.           }
  149.  
  150.           _d_i_a_l_o_g_W_i_d_g_e_t
  151.                     Specifies the dialog widget.
  152.  
  153.           _m_a_p__u_n_m_a_p Specifies a BBBBoooooooolllleeeeaaaannnn value.  If this value is _T_r_u_e,
  154.                     then the trait method should invoke the map
  155.                     callback.  If this value is _F_a_l_s_e, then the trait
  156.                     method should invoke the unmap callback.
  157.  
  158.      RRRREEEELLLLAAAATTTTEEEEDDDD
  159.           XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd(3) and XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll(3).
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                         (printed 10/24/98)
  196.  
  197.  
  198.  
  199.